nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound

AI-powered interview preparation platform. Practice with curated questions, mock interviews, and personalized learning paths to crack your dream tech interview.

Quick Links

  • Technologies
  • Saved Questions
  • Pricing

Company

  • About Us
  • Contact Us

Legal

  • Privacy Policy
  • Terms of Use

© 2026 nextRound. All rights reserved.

TOPIC OVERVIEW

HTML/Custom Elements & Web Components

Creating your own reusable, encapsulated HTML elements using native browser standards.

10 QuestionsAdvancedMedium Priority ~13 min read

Web Components are a set of native browser standards for building reusable elements without a framework. Custom Elements let you define your own tag (the name must contain a hyphen, like <user-card>) by extending HTMLElement and registering it with customElements.define. Shadow DOM provides encapsulation, so the component's internal markup and styles don't leak out or get overridden by the page, and HTML templates with <template> and <slot> define reusable structure and content projection.

Custom elements have lifecycle callbacks such as connectedCallback, disconnectedCallback and attributeChangedCallback, which let them react to being added to the page, removed, or having observed attributes change. Interviewers often ask how Web Components compare to React or Vue components: they are framework-agnostic and built into the browser, but offer less tooling for state management and rendering. Understanding open versus closed shadow roots and how styling crosses the boundary through CSS custom properties and ::part is a good advanced differentiator.

What you'll walk away knowing

The three pillars: custom elements, shadow DOM and templates with slots
Why custom element names require a hyphen and how to register them
The lifecycle callbacks and how observed attributes work
How Web Components differ from framework components and how styling crosses the shadow boundary
1What are Web Components?Intermediate2What are Web Components?Intermediate
All Topics
1
Basics
Common Tags
Attributes and Elements
Lists
Text tags and Formatting
2
Input and Forms
Block and Inline Elements
Box model
3
Semantic Tags
Links and Images
Media and Embeds
Tables
HTML entities
HTML and CSS
4
Performance
SEO
Progressive Enhancement
5
HTML5
Custom Elements & Web Components
HTML5 APIs
SPAs
6
WCAG
Security
Best Practices
Sharethis topic

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.